from Data.data_loader import DataLoader
import pandas as pd
import Estimation.ext_measure as ext
from tqdm import tqdm


save_path = "HepTh.csv"

loader = DataLoader(944175600)
# loader = DataLoader(844175600)
loader.read_data()
graph = loader.graph
ext.calc_measure(graph, graph.start_time)

columns = []
for index in range(11):
    columns.append(index)
df = pd.DataFrame(columns=columns)

datas = []
for vertex in tqdm(graph.vertices):
    items = list(vertex.measures.keys())
    measures = list(vertex.measures.values())
    for index in range(len(measures)):
        contact = 1 if items[index] in vertex.contact else 0
        scores = measures[index]
        scores.append(contact)
        datas.append(scores)
df = df.append(datas)

df.to_csv(save_path, index=False)

print(1)

